﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Customer_Profile.eCard.DBDao;
namespace Customer_Profile.eCard.CardAccount
{
    public partial class ExpensePrint : System.Web.UI.Page
    {
        string expense_no = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["expense_no"] != null)
            {
                expense_no = Request["expense_no"].ToString();
            }
            bindPage(expense_no); 
        }

        private void bindPage(string expense_dealno)
        {
            try
            {
                DataSet ds = AccountingDao.getDealAllInfo_byExpenseno(int.Parse(expense_dealno));
                //客户信息
                rptCparty.DataSource = ds.Tables[0].DefaultView;
                rptCparty.DataBind();
                //交易信息
                rptDeals.DataSource = ds.Tables[1].DefaultView;
                rptDeals.DataBind();
                //消费信息
                rptExpenseDeals.DataSource = ds.Tables[2].DefaultView;
                rptExpenseDeals.DataBind();
                //消费信息附件
                rptAttach.DataSource = ds.Tables[3].DefaultView;
                rptAttach.DataBind();
                
            }
            catch (Exception ex)
            {
                Comm.LogWrite("ExpensePrint-bindpage:", ex.ToString());
            }
        }
    }
}